﻿<%@ Control Language="c#" AutoEventWireup="false" Inherits="Web.Control.WWW.Resources.ResourcesManage" %>
<div id="Body">
    <div id="CommonCenter">
        <div id="Center9001">
			<div id="Title">
				<div class="H1">Resources Administration</div>
				<div class="Menu"><a href="/resources/admin/reslistadmin.htm"><%if(Page.Request.RawUrl.ToLower().IndexOf("/resources/admin/reslistadmin.htm")>-1){%><strong>Resources List</strong><%} else{%>Resources List<%}%></a> | <a href="/resources/admin/resdetail.htm"><%if(Page.Request.RawUrl.ToLower().IndexOf("/resources/admin/resdetail.htm")>-1){%><strong>Add a New Resource</strong><%} else{%>Add a New Resource<%}%></a></div>
			</div>
			<div id="Center9001Left">
            </div>
            <div id="Center9001Right">
                <div id="Center9001Content">
                    <p><strong>Resource Name:</strong><br />
                        <input id="txtName" type="text" class="common300" value="<%=HttpUtility.HtmlAttributeEncode(Name) %>" /><span name="__V_S" vt="0" elt1="txtName" reg=".{1,50}" style="color:Red;display:none" class="validMsg"><br /><%=GetText("RS045")%></span>
                    </p>
                    <p><strong>Resource Url:</strong><br />
                        <input id="txtUrl" type="text" class="common300" value="<%=Url %>" /><span name="__V_S" vt="0" elt1="txtUrl" reg="\http(s)?://([\w-]+\.)+[\w-]+(/[\w- ./?%&=~]*)?" style="color:Red;display:none" class="validMsg"><br /><%=GetText("RS027")%></span>
                    </p>
                    <p><strong>Category:</strong><br />
                        <select id="SelectCat" class="common300">
					        <option value="0">没有分类的。。</option><%=GetResourceCatSelect("")%>
					    </select>
                    </p>
                    <p><strong>For learning:</strong><br />
                        <select id="SelectLearn" class="common300" onchange="SelectLan()">
					        <%if (AdminAllLearn==true) {%>
					        <%=GetLanguageSelect(LearnLan)%>
					        <%}
                            else{%>
                            <option value="<%=LearnLan %>"><%=GetLanguageText(LearnLan)%></option>
                            <%} %>
					    </select>
					</p>
                    <p><strong>Base language:</strong><br />
                        <select id="SelectBase" class="common300" onchange="SelectLan()">
					        <%if (AdminAllBase==true) {%>
					        <%=GetLanguageSelect(BaseLan)%>
					        <%}
                            else{%>
                            <option value="<%=BaseLan %>"><%=GetLanguageText(BaseLan)%></option>
                            <%} %>
					    </select>
					</p>
                    <p><strong>Page Title:</strong><br />
                        <input id="PageTitle" type="text" class="common300" value="<%=HttpUtility.HtmlAttributeEncode(PageTitle) %>" />
                    </p>
                    <p><strong>Description</strong><br />
                        <textarea id="txtDes" class="common300" cols="" rows=""><%=Desc%></textarea><span name="__V_S" vt="0" elt1="txtDes" reg="[\s\S]{0,1000}" style="color:Red;display:none" class="validMsg"><br /><%=GetText("C1010")%></span>
                    </p>
                    <p><strong>Status</strong><br />
                        <input id="RInactive" type="radio" value="0" name="IsActive" <%=(Active==false?"checked=\"checked\"":"") %> />
                        <label for="RInactive">Inactive</label> 
                        <input id="RActive" type="radio" name="IsActive" value="1" <%=(Active==true?"checked=\"checked\"":"") %> />
                        <label for="RActive">Active</label>
                    </p>
                    <p><strong>Sort</strong><br />
                        <input id="txtSort" type="text" class="common300" value="<%=SortID %>" />
                    </p>
                    <p>
                        <input id="btnSubmit" type="button" value="Save" class="button" onclick="Save()" />
                    </p>                   
                    <div id="Succeed" style="display:none">Submitted Successfully</div>
                    <div id="failure" style="display:none">Submitted failing</div>
                </div>
            </div>
            <div class="clear">
            </div>
        </div>
    </div>
</div>
<%--
var Page_Validators =  new Array($get("valtxtName"),$get("valtxtUrl"), $get("valtxtDes"));
var TmpObj = $get("valtxtName");
TmpObj.controltovalidate = "txtName";
TmpObj.errormessage = "<b>Please enter the resource name.</b>";
TmpObj.display = "None";
TmpObj.evaluationfunction = "RegularExpressionValidatorEvaluateIsValid";
TmpObj.validationexpression = ".{1,50}";

TmpObj = $get("valtxtUrl");
TmpObj.controltovalidate = "txtUrl";
TmpObj.errormessage = "<b>Please check the resources URL.</b>";
TmpObj.display = "None";
TmpObj.evaluationfunction = "RegularExpressionValidatorEvaluateIsValid";
TmpObj.validationexpression = "\\http(s)?://([\\w-]+\\.)+[\\w-]+(/[\\w- ./?%&=~]*)?";

TmpObj = $get("valtxtDes");
TmpObj.controltovalidate = "txtDes";
TmpObj.errormessage = "<b>error.</b>";
TmpObj.display = "None";
TmpObj.evaluationfunction = "RegularExpressionValidatorEvaluateIsValid";
TmpObj.validationexpression = "[\\s\\S]{0,1000}";

var Page_ValidationActive = false;
if (typeof(ValidatorOnLoad) == "function") {
    ValidatorOnLoad();
}
function ValidatorOnSubmit() {
    if (Page_ValidationActive) {
        return ValidatorCommonOnSubmit();
    }
    else {
        return true;
    }
}
function CreateValid()
{
    $create(AjaxControlToolkit.ValidatorCalloutBehavior, 
    {"closeImageUrl":"<%=RootPath%>Scripts/AjaxTools/images/close.gif","highlightCssClass":"validatorCalloutHighlight",
     "id":"valtxtName","warningIconImageUrl":"<%=RootPath%>Scripts/AjaxTools/images/alert-small.gif"}, null, null, $get("valtxtName"));
    $create(AjaxControlToolkit.ValidatorCalloutBehavior, 
    {"closeImageUrl":"<%=RootPath%>Scripts/AjaxTools/images/close.gif","highlightCssClass":"validatorCalloutHighlight",
     "id":"valtxtUrl","warningIconImageUrl":"<%=RootPath%>Scripts/AjaxTools/images/alert-small.gif"}, null, null, $get("valtxtUrl"));
    $create(AjaxControlToolkit.ValidatorCalloutBehavior, 
    {"closeImageUrl":"<%=RootPath%>Scripts/AjaxTools/images/close.gif","highlightCssClass":"validatorCalloutHighlight",
     "id":"valtxtDes","warningIconImageUrl":"<%=RootPath%>Scripts/AjaxTools/images/alert-small.gif"}, null, null, $get("valtxtDes"));    
}
<span id="valtxtName" style="color: Red; display: none;" class="red10"></span>
<span id="valtxtUrl" style="color: Red; display: none;" class="red10"></span>
<span id="valtxtDes" style="color: Red; display: none;" class="red10"></span>--%>
<script>
var Memberno = "<%=memberno %>";
var NoPageID = "当前没有此资源页，请添加";
var PageID = <%=PageID %>;
var SaveType = <%=SaveType %>;
var ResID = <%=ResID %>;

</script>
